using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Practices.EnterpriseLibrary.Data.Configuration;
using System.Data.SQLite;
using Microsoft.Practices.EnterpriseLibrary.Data;

namespace EntLibContrib.Data.SQLite
{
    /// <summary>
    /// 
    /// </summary>
    [DatabaseAssembler(typeof(SQLiteDatabaseAssembler))]
    public class SQLiteDatabase : Database
    {
        private string connectionString;

        /// <summary>
        /// Initializes a new instance of the SQLiteDatabase class.
        /// </summary>
        public SQLiteDatabase(string connectionString) : base(connectionString, SQLiteFactory.Instance)
        {
            this.connectionString = connectionString;
        }

        ///// <summary>
        ///// Creates the connection.
        ///// </summary>
        ///// <returns></returns>
        //public System.Data.Common.DbConnection CreateConnection()
        //{
        //    return new System.Data.SQLite.SQLiteConnection(connectionString);
        //}

        ///// <summary>
        ///// Gets the SQL string command.
        ///// </summary>
        ///// <param name="p">The p.</param>
        ///// <returns></returns>
        //public System.Data.Common.DbCommand GetSqlStringCommand(string p)
        //{
        //    return new System.Data.SQLite.SQLiteCommand(p);
        //}

        /// <summary>
        /// Retrieves parameter information from the stored procedure specified in the <see cref="SQLiteCommand"/> and populates the Parameters collection of the specified <see cref="SQLiteCommand"/> object.
        /// </summary>
        /// <param name="discoveryCommand">The <see cref="SQLiteCommand"/> to do the discovery.</param>
        protected override void DeriveParameters(System.Data.Common.DbCommand discoveryCommand)
        {
            throw new Exception("The method or operation is not implemented.");
        }
    }
}
